package com.xiaoran.goods20013.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaoran.goods20013.entity.XrGoods;
import com.xiaoran.goods20013.mapper.XrGoodsMapper;
import com.xiaoran.goods20013.service.IXrGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author xiaoRan
 * @since 2022-02-25
 */
@Service
public class XrGoodsServiceImpl extends ServiceImpl<XrGoodsMapper, XrGoods> implements IXrGoodsService {
    @Autowired
    XrGoodsMapper xrGoodsMapper;

    @Override
    public Integer addOne(XrGoods data) {
        return xrGoodsMapper.insert(data);
    }

    @Override
    public List<XrGoods> getList(Long storeid, Long gtid) {
        return xrGoodsMapper.selectList(new QueryWrapper<XrGoods>()
                .eq("goods_type", gtid)
                .eq("goods_st_id", storeid));
    }
}
